<template>
  <base-breadcrumb>
    <a-card>
      <a-form-model :model="form" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
                    :wrapperCol="{ lg: { span: 16 }, sm: { span: 16 } }">
        <a-row :gutter="24">
          <a-col :md="18" :sm="18">
            <a-form-model-item label="所属单位" prop="informant">
              <a-input v-model="form.informant" :disabled="true"/>
            </a-form-model-item>
            <a-form-model-item label="上报时间" prop="fulfillDate">
              <a-date-picker v-model="form.fulfillDate" :disabled="true"
                             @change="(date, dateString) => getTime(date, dateString, 'form', 'fulfillDate')"/>
            </a-form-model-item>
          </a-col>
          <a-col :md="18" :sm="18">
            <a-form-model-item label="附件上传">
              <upload-list :businessCode="'BM19'" :isClose=false :uploadArrys.sync="form.files" ></upload-list>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-card>
  </base-breadcrumb>
</template>
<script>

import UploadList from '@/components/UploadList'
import {getDischargeOne} from "@/api/businessAffairs/assessmentFulfillment";
import moment from "moment/moment";

export default {
  name: 'a' + Date.now(),
  components: {
    UploadList,
  },
  props: {
    // 是否作为审批详情
    isAudit: {
      type: Boolean,
      default: false
    },
    // 是否作为意见征询
    isConsultation: {
      type: Boolean,
      default: false
    },
  },
  data() {
    return {
      form: {
        fulfillDate: null,
        informant:'',
        files:[]
      }
    }
  },
  async created() {
    this.getLists()
  },
  methods: {
    getTime(date, dateString, type, name) {
      this[type][name] = dateString
      console.log(this[type][name])
    },
    // 获取详情
    getLists() {
      getDischargeOne({id: this.$route.query.id}).then((res) => {
        if (res.code == 200) {
          const data = res.data
          this.form = data
          this.form.files = res.data.reviewFileInfoVOList
          this.form.fulfillDate = moment().format("YYYY-MM-DD")
          this.form.informant = this.form.branchComName + '/' + this.form.projectName
        }
      })
    }
  }
}
</script>
